#ifndef PIECE_HPP
#define PIECE_HPP

#include "piece.hpp"
#include <cstdint>
#include <iostream>

#endif  // PIECE_HPP
#define RED 1
#define black 1

using std::string;

class distance{
public:
  int disx,disy;
  distance()
  {
    this->disx = 0;
    this->disy = 0;
  }
};

class coordinate
{
public:
  int x;
  int y;

  coordinate(){
    x = 'A';
    y = 1;
  }

  coordinate operator+(const coordinate t)const noexcept
  {
    coordinate m;
    m.x = this->x + t.x;
    m.y = this->y + t.y;
    return m;
  }

  coordinate operator-(const coordinate t)const noexcept
  {
    coordinate m;
    m.x = this->x - t.x;
    m.y = this->y - t.y;
    return m;
  }

  coordinate & operator+=(const coordinate t)noexcept
  {
    this->x += t.x;
    this->y += t.y;
    return *this;
  }

  coordinate & operator-=(const coordinate t)noexcept
  {
    this->x -= t.x;
    this->y -= t.y;
    return *this;
  }

  static int disy(const piece & a,const piece & b)
  {
    class distance t;
    t.disx = abs((a.coor-b.coor).x);
    t.disy = abs((a.coor-b.coor).y);
    return t.disx;
  }
  
  static int disx(const piece & a,const piece & b)
  {
    class distance t;
    t.disx = abs((a.coor-b.coor).x);
    t.disy = abs((a.coor-b.coor).y);
    return t.disy;
  }
  
};